# -*- coding: UTF-8 -*-

# 迭代list
from collections import Iterable

i = list(range(10))
for x in i:
    print x

# 迭代dict
dict = {"a": 1, "b": 2, "d": 4}
print "========== 迭代key =========="
# 迭代key
for x in dict:
    print x
print "========== 迭代value =========="
# 迭代value
for x in dict.values():
    print x
print "========== 迭代key and value =========="
for x, y in dict.items():
    print x, y

print "========== 迭代字符串 =========="
for x in "ABC":
    print x

print "========== 判断是否可迭代 =========="
print isinstance("ABC", Iterable)
print isinstance([1, 2], Iterable)
print isinstance(123, Iterable)
